#### INSTALL AND LOAD PACKAGES ==========================================================

# install pacman package if not installed -----------------------------------------------
suppressWarnings(if (!require("pacman")) install.packages("pacman"))

# load packages and install if not installed --------------------------------------------
pacman::p_load(tidyverse, ggplot2, haven, magrittr, dplyr, readr, lubridate, estimatr, texreg,
               sandwich, janitor, psych, quanteda, emmeans, gridExtra, gt, webshot2, gtExtras,
               randomForest, caret, tidytext,
               install = TRUE,
               update = FALSE)

# show loaded packages ------------------------------------------------------------------
cat("loaded packages\n")
print(pacman::p_loaded())
